//
//  ORPageViewController.m
//  NewsHots
//
//  Created by rimi on 2016/12/1.
//  Copyright © 2016年 zhongshuilian. All rights reserved.
//

#import "ORPageViewController.h"


#define degreesToRadians(degrees) ((degrees * (float)M_PI) / 180.0f)

@interface ORPageViewController ()

@end

@implementation ORPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self initalizeDataSource];
    
}


- (void)initalizeDataSource{
    
    float  dist=100; //半径
    
    for (int i=1; i<=6; i++) {
        
        float angle=degreesToRadians((360/6)*i);
        
        float y=cos(angle) *dist;
        float x=sin(angle) *dist;
        
        UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
        
        btn.frame=CGRectMake(0, 0, 70, 70);
        
        btn.layer.cornerRadius=35;
        btn.layer.masksToBounds=YES;
        [btn setBackgroundColor:[UIColor whiteColor]];
        
        CGPoint center=CGPointMake(self.view.center.x+x, self.view.center.y+y+20);
        
        btn.center=center;
        
        [self.view  addSubview:btn];
        
    }
    
    
}

@end
